<!DOCTYPE html>
<html lang="en">

<!--head-->
<?php require_once('./common_php/head.php');  ?>
<!--head end-->

<!-- js -->
<?php require_once('./common_php/js.php');  ?>
<!-- js end-->

<script>
</script>
<body>

	<!-- topbar-->
	<?php require_once('./common_php/top.php');  ?>
	<!-- topbar end-->

		<div class="container-fluid">
		<div class="row-fluid">

			<!-- menu_left -->
			<?php require_once('./common_php/menu_left.php');  ?>	
			<!-- menu_left end -->

			<!-- no_script -->
			<?php require_once('./common_php/noscript.php');  ?>	
			<!-- no_script end -->			
			
			<div id="content" class="span9">

			<!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts -->
			<!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts -->
			<!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts -->
			
			<div class="row-fluid sortable">		
				<div class="box span8">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-envelope"></i> 転送リスト</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
					</div>
					<div class="box-content">
						<table class="table table-striped table-bordered bootstrap-datatable datatable">
						  <thead>
							  <tr>
								  <th>名前</th>
								  <th>宛先</th>
								  <th><a class="btn btn-info btn-forward-plus" href="#" >
                                                                                転送先を作成 	
                                                                        </a></th>
							  </tr>
						  </thead>   
						  <tbody>
							<?php 
							$relay_arr=array();
							$file_handle = fopen("/etc/postfix/relay_recipients", "r");
                                                        while (!feof($file_handle)) {
								$line = fgets($file_handle);
								$info = explode(' ',$line);
								if($info[0]!=""&&$info[1]!=""){
									$relay_arr[]=$info[0];
									echo "<tr><td>".$info[0]."</td><td class=\"center\">".$info[1]."</td>";
									echo "<td class=\"center\"><a class=\"btn btn-info\" href=\"#\" id=\"btn-edit\" onclick=\"getBtnEditVR(event);\"> 修正 </a> <a class=\"btn btn-danger\" href=\"#\" onclick=\"deleVR(event);\"> 削除 </a></td>";
								}
							}
							fclose($file_handle);
							?>
						</tbody>
					  </table>            
					</div>
				</div><!--/span-->
			
			</div><!--/row-->

		
		  
       
			<!-- content ends --><!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts -->
			<!-- content ends --><!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts -->
			<!-- content ends --><!-- content starts --><!-- content starts --><!-- content starts --><!-- content starts -->

			</div><!--/#content.span10-->
				</div><!--/fluid-row-->
				
		<hr>


			<!-- hide -->
			<div class="modal hide fade" id="forward_edit_hide">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">×</button>
					<h3>転送先の修正</h3>
				</div>
				<div class="modal-body">
					<table class="table table-bordered table-striped">
						<tr>
							<td>名前</td>
							<td><input class="input-xlarge disabled hide_edit_mail_name" id="disabledInput" type="text" value=""  disabled=""></td>
                                                </tr>
						<tr>
                                                        <td>宛先</td>
                                                        <td>
							<input id="input-xlarge" size="16" type="text" class="hide_plus_mail_name" style="width:283px" value="">	
							</td>
                                                </tr>
					</table>
				</div>
				<div class="modal-footer">
					<a href="#" class="btn" data-dismiss="modal">Close</a>
					<a href="#" class="btn btn-edit-mail-submit">Save changes</a>
				</div>
			</div>
			<!-- hide end-->
                        <!-- hide -->
                        <div class="modal hide fade" id="forward_plus_hide">
                                <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal">×</button>
                                        <h3>新しい転送先の作成</h3>
                                </div>
                                <div class="modal-body">
                                        <table class="table table-bordered table-striped">
                                                <tr>
                                                        <td>名前</td>
                                                        <td><div class="control-group">
									<div class="controls">
									  <select id="selectError" data-rel="chosen" style="width:130px;relative;top:10px" class="hide_forward_mail_O_plus_name">
										<?php
										include_once("config.php");

										$file_handle2 = fopen("/etc/passwd", "r");
										while (!feof($file_handle2)) {
											$line2 = fgets($file_handle2);
											$info2 = explode(':',$line2);
											if((int)$info2[2] > 499){
												echo "<option value=".$info2[0].">".$info2[0]."</option>";
											}
										}
										fclose($file_handle2);
										?>
									  </select>
									<span class="help-inline"> @ <input id="input-xlarge disabled" size="16" type="text" class="hide_forward_mail_D_plus_name" style="width:130px" value="<?php echo $domain_name ?>" disabled=""></span>
									</div>
									</div>
								</div>
							</td>
						
                                                </tr>
                                                <tr>
                                                        <td>宛先</td>
                                                        <td><input id="input-xlarge" size="16" type="text" class="hide_forward_plus_name" style="width:283px" value="">
                                                        </td>


                                                </tr>
                                        </table>
                                </div>
                                <div class="modal-footer">
                                        <a href="#" class="btn" data-dismiss="modal" >Close</a>
                                        <a href="#" class="btn" id="hide_mail_plus_submint">Save changes</a>
                                </div>
                        </div>
                        <!-- hide end-->

		<!-- footer-->
		<?php require_once('./common_php/footer.php');  ?>
		<!-- footer end-->
		
	</div><!--/.fluid-container-->

	<!-- js -->
	<?php require_once('./common_php/js.php');  ?>
	<!-- js end-->
		
</body>
</html>
